/**
 * Copyright &copy; 2015-2020 <a href="http://www.easyhis.com/">easyhis</a> All rights reserved.
 */
package com.easy.modules.tools.service;

import com.easy.core.persistence.Page;
import com.easy.core.service.BaseService;
import com.easy.modules.tools.entity.TestInterface;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collection;
import java.util.List;

/**
 * 接口Service
 * @author lgf
 * @version 2016-01-07
 */
public interface TestInterfaceService extends BaseService {

	/**
	 * 获取单条数据
	 * @param id
	 * @return
	 */
	public TestInterface get(Integer id);

	/**
	 * 获取单条数据
	 * @param entity
	 * @return
	 */
	public TestInterface get(TestInterface entity) ;

	/**
	 * 查询列表数据
	 * @param entity
	 * @return
	 */
	public List<TestInterface> findList(TestInterface entity);

	/**
	 * 查询分页数据
	 * @param page 分页对象
	 * @param entity
	 * @return
	 */
	public Page<TestInterface> findPage(Page<TestInterface> page, TestInterface entity);

	/**
	 * 保存数据（插入或更新）
	 * @param entity
	 */
	@Transactional(readOnly = false)
	public void save(TestInterface entity);

	/**
	 * 删除数据
	 * @param entity
	 */
	@Transactional(readOnly = false)
	public void delete(TestInterface entity);


	/**
	 * 删除全部数据
	 * @param entitys
	 */
	@Transactional(readOnly = false)
	public void deleteAll(Collection<TestInterface> entitys) ;

	/**
	 * 删除全部数据
	 * @param entitys
	 */
	@Transactional(readOnly = false)
	public void deleteAllByLogic(Collection<TestInterface> entitys);


	/**
	 * 获取单条数据
	 * @param propertyName, value
	 * @return
	 */
	public TestInterface findUniqueByProperty(String propertyName, Object value);

	/**
	 * 动态sql
	 * @param sql
	 */

	public List<Object> executeSelectSql(String sql);

	@Transactional(readOnly = false)
	public void executeInsertSql(String sql);

	@Transactional(readOnly = false)
	public void executeUpdateSql(String sql);

	@Transactional(readOnly = false)
	public void executeDeleteSql(String sql);

}